﻿var LocalUserInfo = null;
var user = null;
    LocalUserInfo = sessionStorage.getItem("user");

if (LocalUserInfo === null || LocalUserInfo === undefined) {
    window.top.location.href = "login.html";
} else {
    user = JSON.parse(LocalUserInfo);
}

if (user === null || user === undefined || user.userId === undefined || user.userName === undefined) {
    alert("用户信息失效，请重新登录！");
    window.top.location.href = "login.html";
}
function logout() {
    LocalUserInfo = null;
    user = null;
    sessionStorage.clear();
}
